package com.huanong.it.xwuser.authority.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import org.springframework.security.core.GrantedAuthority;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Set;

/**
 * @TableName sys_user
 */
@TableName(value ="sys_user")
@Data
public class User  implements Serializable {
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 账号
     */
    private String username;
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private String password;

    private String avatar;

    private String email;

    private String city;

    private Date created;

    private Date updated;

    private Date lastLogin;

    private Integer statu;

    private String nickname;

    private String phone;
    @TableField(exist = false)
    private Set<GrantedAuthority> authorities;
    @TableField(exist = false)
    private Set<Role> roles;

    @TableField(exist = false)
    private List<Menu> menus;

    private static final long serialVersionUID = 1L;
}
